package com.spotalog.shared.model;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import lombok.Data;
import lombok.EqualsAndHashCode;

import com.googlecode.objectify.annotation.Embed;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.Index;
import com.googlecode.objectify.condition.IfTrue;

@Data
@Entity
@EqualsAndHashCode(callSuper = true)
public class User extends DatastoreObject implements Locatable {
	@NotNull
	@Size(min = 2)
	private String firstName;
	@NotNull
	@Size(min = 2)
	private String lastName;
	@NotNull
	private String email;
	@Index(IfTrue.class)
	private boolean isOnline = false;
	@Index(IfTrue.class)
	private boolean isVisible = false;

	@Embed
	private Location location;
	@Embed
	private Photo photo;
}
